import { Radio, RadioChangeEvent } from 'antd';
import { NbRadioWidgetScheme } from './scheme';

export default function NbRadioGroupWidget(props: NbRadioWidgetScheme) {
  const { value, onChange, ...res } = props;

  function handleChange(e: RadioChangeEvent) {
    onChange?.(e.target.value);
  }

  return <Radio.Group onChange={handleChange} value={value} {...res} />;
}
